🐛Update items.py to return status code 403 in case of insufficient permissions#1543
Merged
tiangolo merged 3 commits intofastapi:masterfrom Jan 22, 2026
Merged
🐛Update items.py to return status code 403 in case of insufficient permissions#1543tiangolo merged 3 commits intofastapi:masterfrom
items.py to return status code 403 in case of insufficient permissions#1543tiangolo merged 3 commits intofastapi:masterfrom
Conversation
Change error 400 to error 403 when not enough permissions when requesting items
updated tests
Chikimuras
approved these changes
Apr 23, 2025
YuriiMotov
approved these changes
Sep 3, 2025
Member
There was a problem hiding this comment.
LGTM
For users we already return status code 403
full-stack-fastapi-template/backend/app/api/routes/users.py
Lines 168 to 172 in 8af907c
@jpizquierdo, thanks!
I think we don't need to change frontend to reflect these changes right now - users only see items they have access to, so they will not be able to send invalid request.
But in general we should probably discuss the way 403 errors are handled by frontend. For now UI will remove the access token and ask user to login.
items.py to return status code 403 in case of insufficient permissions
Contributor
|
This pull request has a merge conflict that needs to be resolved. |
samsam926
pushed a commit
to samsam926/KD-Path
that referenced
this pull request
Jan 28, 2026
This was referenced Feb 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change error 400 to error 403 when not enough permissions when requesting items. I think it is better a 403 than a 400 (bad request).